
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>上传excle表</title>
</head>
<body>
<div style="width:40%;margin: auto;padding:5%">
    <form id="uploadForm" enctype="multipart/form-data" action="/excel/insertExcel"
          method="post" onsubmit="return saveReport();">
        <!--  target="nm_iframe"" -->
        <input class="file input" type="file" id="file" name="file"
               multiple="multiple" /><label>请上传对应的软件Excel，过滤后会自动下载</label> <input type="submit"
              onclick="return check(file)" value="点击上传"
              style="position: relative; top: 0px; left: 180px; height: 24px;" />
        <!--  <button id="upload" type="button" onclick="picture();">上传</button>  -->
    </form>
    <!-- <iframe id="id_iframe" name="nm_iframe" style="display:none;"></iframe> -->
</div>
<script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript">
    function saveReport() {
        // jquery 表单提交
        $("#uploadForm").ajaxSubmit(function(message) {
            // 对于表单提交成功后处理，message为提交页面saveReport.htm的返回内容
            alert(message);
        });
        return false; // 必须返回false，否则表单会自己再做一次提交操作，并且页面跳转
    }
    function check(file) {
        if (file.value == null || file.value == "") {
            alert("请您选择要导入的Excel数据!");
            return false;
        }
    }
</script>
</body>
</html>
